﻿<Window x:Class="NMortgage.UI.Views.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Properties="clr-namespace:NMortgage.UI.Properties"
        xmlns:converters="clr-namespace:NMortgage.UI.Converters"
        Title="{x:Static Properties:Resources.MainTitle}"
        Height="700"
        Width="1150">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Themes/CommonStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <converters:TabSizeConverter x:Key="tabSizeConverter" />

            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Header"
                        Value="{Binding Path=Title}" />
                <Setter Property="Width">
                    <Setter.Value>
                        <MultiBinding Converter="{StaticResource tabSizeConverter}">
                            <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}" />
                            <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}"
                                     Path="ActualWidth" />
                        </MultiBinding>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Margin="10">
        <TabControl x:Name="Views"/>
    </Grid>
</Window>
